<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui/css/layui.css"  media="all">
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
    <legend>网易热榜新闻抓取控制</legend>
</fieldset>


<button id="begin" class="layui-btn layui-btn-lg layui-btn-radius layui-btn-normal">开始抓取数据</button>
<button id="end" class="layui-btn layui-btn-lg layui-btn-radius layui-btn-danger">暂停抓取数据</button>
<p/>
<blockquote class="layui-elem-quote">智慧新闻->爬虫控制->网易热榜新闻爬取<a href="mailto:yyd8358@foxmail.com" style="color:red;text-align: center;display:block;line-height: 10px;">用于毕设，请勿他用2021@版权所有 yyd8358@foxmail.com</a></blockquote>
<script src="/lib/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use(['layer', 'form'], function(){
        var $ = layui.$;
        var layer = layui.layer
            ,form = layui.form;

        $("#begin").click(function (){
            $.post("/beginCrawlData",null,function (data) {
                if (data != null && data.code == '0'){
                    layer.msg('蜘蛛启动成功！请过一会儿刷新数据！', {icon: 6});
                }
            });
        });
        $("#end").click(function (){
            $.post("/stopcrawlData",null,function (data) {
                if (data != null && data.code == '0'){
                    layer.msg('爬虫已停止！', {icon: 6});
                }
            });
        });
    });

</script>
</body>
</html>